<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BuscarArticulo.aspx.cs" Inherits="Admin_BuscarArticulo" %>

<%@ Register Src="../UserControls/Rubros.ascx" TagName="Rubros" TagPrefix="uc1" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Buscar Art&iacute;culo</title>
    <link href="../App_Themes/Default.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center; vertical-align: text-top;">
    <asp:ScriptManager id="ScriptManager1"
                runat="server"></asp:ScriptManager>

<table class="tablaForm" style=" width: 550px; text-align:left">
    <tr>
        <td class="tdStock" align="right" colspan="3" style="height: 17px">
            Buscar Art&iacute;culo</td></tr>
    <tr>
        <td class="tdForm" colspan="2">
            <uc1:Rubros ID="Rubros1" runat="server" />
        </td>
    </tr>
      <tr>
                <td align="right" class="tdForm" style="width: 20%">
                    C&oacute;digo:&nbsp;</td>
                <td align="left" class="tdForm" style="width: 80%">
                    <asp:TextBox ID="txtCodigo" runat="server" CssClass="cuadrotxt"></asp:TextBox></td>
            </tr>
            <tr>
                <td align="right" class="tdForm" style="width: 20%; height: 23px">
                    Art&iacute;culo:&nbsp;</td>
                <td align="left" class="tdForm" style="width: 80%; height: 23px">
                    <asp:TextBox ID="txtArticulo" runat="server" CssClass="cuadrotxt100"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tdBotones" colspan="2">
                    <asp:Button ID="btnBuscar" runat="server" OnClick="btnBuscar_Click" Text="Buscar"
                        Width="75px" />&nbsp;
                    <input type="button" onclick="javascript:window.close()" value="Cancelar" style="width: 75px" />
                </td>
            </tr>
    <tr>
        <td style="WIDTH: 550px" class="tdForm" colspan="2">
            <asp:GridView id="gvStock" runat="server" BorderWidth="1px" BackColor="White" Width="100%" 
                OnRowDataBound="gvStock_RowDataBound"
                OnPageIndexChanging="gvStock_PageIndexChanging" 
                OnSelectedIndexChanged="gvStock_SelectedIndexChanged" 
                CellPadding="3" AllowPaging="True" AutoGenerateColumns="False" 
                DataKeyNames="Id_Articulo" BorderColor="#999999" BorderStyle="None" GridLines="Vertical" PageSize="15">
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black"></FooterStyle>
                <columns>
                     <asp:TemplateField ShowHeader="False">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:HiddenField id="hdnRubro" runat="server"  Value='<%# Bind("Id_Rubro") %>'/>
                            <asp:HiddenField id="hdnSubRubro" runat="server"  Value='<%# Bind("Id_SubRubro") %>'/>
                        </ItemTemplate>
                        </asp:TemplateField>
                    <asp:TemplateField HeaderText="C&#243;digo">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="IdArticulo" runat="server" Text='<%# Bind("Id_Articulo") %>'></asp:Label> 
                        </ItemTemplate>
                        </asp:TemplateField>
                     <asp:TemplateField HeaderText="Articulo">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="Articulo" runat="server" Text='<%# Bind("Articulo") %>'></asp:Label> 
                        </ItemTemplate>
                        </asp:TemplateField>
                     <asp:TemplateField HeaderText="Lote">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="Lote" runat="server" Text='<%# Bind("Lote") %>'></asp:Label> 
                        </ItemTemplate>
                        </asp:TemplateField>
                      <asp:TemplateField HeaderText="Fecha Vto.">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="FechaVto" runat="server" Text='<%# Bind("FechaVto", "{0:dd/MM/yyyy}") %>'></asp:Label> 
                        </ItemTemplate>
                         <ItemStyle HorizontalAlign="Center" />
                        </asp:TemplateField>
                      <asp:TemplateField HeaderText="Precio">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="Precio" runat="server" Text='<%# Bind("Precio", "{0:F2}") %>'></asp:Label> 
                        </ItemTemplate>
                        </asp:TemplateField>
                     <asp:TemplateField HeaderText="Saldo">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="Saldo" runat="server" Text='<%# Bind("Saldo", "{0:F2}") %>'></asp:Label> 
                        </ItemTemplate>
                        </asp:TemplateField>
                     <asp:TemplateField HeaderText="CodBarra">
                        <HeaderStyle ForeColor="White" HorizontalAlign="Center"></HeaderStyle>
                        <ItemTemplate>
                            <asp:Label id="CodBarra" runat="server" Text='<%# Bind("CodigoBarra") %>'></asp:Label> 
                        </ItemTemplate>
                        </asp:TemplateField>
                    <asp:TemplateField ShowHeader="False">
                        <HeaderStyle ForeColor="White" />
                        <ItemTemplate>
                            <a href="javascript:returnvalue('<%# ((GridViewRow)Container).FindControl("IdArticulo").ClientID%>','<%# ((GridViewRow)Container).FindControl("Articulo").ClientID%>','<%# ((GridViewRow)Container).FindControl("Saldo").ClientID%>','<%# ((GridViewRow)Container).FindControl("Precio").ClientID%>','<%# ((GridViewRow)Container).FindControl("Lote").ClientID%>','<%# ((GridViewRow)Container).FindControl("CodBarra").ClientID%>')">Seleccionar</a> 
                        </ItemTemplate>
                    </asp:TemplateField>
                </columns>
                <RowStyle BackColor="#EEEEEE" ForeColor="Black" HorizontalAlign="Center"></RowStyle>
                <EditRowStyle Wrap="True"></EditRowStyle>
                <SelectedRowStyle BackColor="#008A8C" ForeColor="White" Font-Bold="True"></SelectedRowStyle>
                <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center"></PagerStyle>
                <HeaderStyle BackColor="#325FB9" ForeColor="White" Font-Names="Arial Rounded MT Bold" Font-Bold="True"></HeaderStyle>
                <AlternatingRowStyle BackColor="Gainsboro"></AlternatingRowStyle>
            </asp:GridView>
            </td>
            </tr>
        </table><br /><br />
    </div>
     <asp:Panel ID="pTipo" runat="server" CssClass="tdBotones" Style="display: none" Width="233px">
        <div style="text-align:center; background-image: none; background-color: transparent;">
            Art&iacute;culo sin Lote Abierto<br />
            <br />
            <asp:Button ID="btnOkTipo" runat="server" Text="OK" Width="64px"/>
        </div>
    </asp:Panel>
       <table border="0" id = "OcultarTipo" runat="server" style="width: 0px; height: 0px">
            <tr>
                <td style="width: 100px; height: 18px;">
                    <asp:Button ID="Button3" runat="server" Text="Button" Height="0px" Width="0px" />
                </td>
            </tr>
        </table>          
     <cc1:ModalPopupExtender ID="mpeLote" runat="server" backgroundcssclass="modalBackground"
        dropshadow="true" okcontrolid="btnOkTipo" popupcontrolid="pTipo" targetcontrolid="Button3">
    </cc1:ModalPopupExtender>
 </form>
</body>
</html>
